#include "hall.h"
#include "pid.h"
#include "motor.h"

//HALL SENSOR
#define HALL_A_PIN 2
#define HALL_B_PIN 3

//PID params
#define PID_KP 0.5
#define PID_KI 0.2
#define PID_KD 0.1
int main()
{
  struct hall_sensor *hall = NULL;
  struct electric_motor *motor = NULL;
  float current_position = 0, target_position = 10, output = 0;

  hall = hall_new(HALL_A_PIN, HALL_B_PIN);
  hall_interrupt_setup(hall);
  motor = motor_h_bridge_new(MOTOR_A, MOTOR_B, MOTOR_C, MOTOR_D);
  motor_set_sensor(motor, MOTOR_HALL_SENSOR, hall);
  motor_turn(motor, target_position);
}
